LearningDataModel.CreateRubric Method

Creates a Rubric object, which may then be used to be added to an Interaction.Rubrics list.

Parent Type: LearningDataModel

Namespace: Microsoft.LearningComponents.DataModel

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public Rubric CreateRubric ()

Return Value

A new Rubric object associated with this LearningDataModel.

Exceptions
Exception type Condition
InvalidOperationException

Thrown if this LearningDataModel object cannot be written to.

Example

The following example demonstrates creating a new rubric and adding it to an Interaction.Rubrics collection.

C#
LearningSession session = ... ; // get LearningSession object

Interaction i = session.CurrentActivityDataModel.CreateInteraction();
i.Id = "interaction1"; // A unique identifier is required before this is added to the list
i.InteractionType = InteractionType.TrueFalse;
Rubric r = session.CurrentActivityDataModel.CreateRubric();
r.Points = 3;
i.Rubrics.Add(r);
session.CurrentActivityDataModel.Interactions.Add(i);